package com.pubinfo.passbook.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pubinfo.passbook.common.entity.TRabbitmqOrgPersonMerge;
import com.pubinfo.passbook.common.entity.TRabbitmqPersonConvert;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * @author zhouch
 */
public interface TRabbitmqOrgPersonMergeMapper extends BaseMapper<TRabbitmqOrgPersonMerge> {
  
  void insertBatch(List<TRabbitmqOrgPersonMerge> list);
  
  /**
   * 通过组织ID查询出所有与该组织存在关联的用户
   *
   * @param orgId
   * @return
   */
  IPage<TRabbitmqPersonConvert> getPersonsListByOrgRefs(IPage<?> page, @Param("orgId") Long orgId, @Param("realname") String realname);
  
  /**
   * 通过多个组织ID查询出所有与该组织存在关联的用户
   *
   * @return
   */
  IPage<TRabbitmqPersonConvert> getPersonsListByOrgsRefs(IPage<?> page, @Param("orgIds") Collection<Long> orgIds, @Param("realname") String realname);
  
  List<TRabbitmqPersonConvert> getPersonsListByOrgsRefs(@Param("orgIds") Collection<Long> orgIds, @Param("realname") String realname);
  
  Integer userSameOrg(@Param("id1") String id1, @Param("id2") String id2);
}
